<template>
  <div class="world">
    <!-- 顶部搜索框 -->
    <head-search></head-search>
    <!-- 轮播图 -->
    <lb-img></lb-img>
    <!-- 首页分类 -->
    <home-cla></home-cla>
    <!-- 商品详情1 -->
    <content-ele></content-ele>
    <botton-ele></botton-ele>
  </div>
</template>

<script>
// 底部导航组件
import bottonEle from "../components/common/botton.vue";
// 顶部搜索组件
import headSearch from "../components/home/headNav.vue";
// 轮播图
import lbImg from "../components/home/lbImg.vue";
// 首页分类
import homeCla from "../components/home/home_cla.vue";
// 商品详情
import contentEle from "../components/home/content1.vue";

export default {
  data() {
    return {
      dataLb: {},
      dataNavcla: {},
      dataAllinfo: [],
      active: 0,
    };
  },
  components: {
    headSearch,
    lbImg,
    homeCla,
    contentEle,
    bottonEle,
  },
  created() {
    // 轮播图
    let info = {
      type: "get",
      url: "/home/sliders",
    };

    this.$netWork(info).then((res) => {
      if (res.data.status === 0) {
        this.dataLb = res.data.data;
      }
    });

    // 导航分类
    let info2 = {
      type: "get",
      url: "/home/category",
    };
    this.$netWork(info2).then((res) => {
      if (res.data.status === 0) {
        this.dataNavcla = res.data.data;
      }
    });

    // 首页商品
    let info3 = {
      type: "get",
      url: "/home/floorlist",
    };
    this.$netWork(info3).then((res) => {
      if (res.data.status === 0) {
        res.data.data.forEach((item) => {
          this.dataAllinfo.push(item);
        });
      }
    });
  },
};
</script>

<style lang="scss" scoped>
.world {
  width: 100%;
  height: 100%;
}
</style>
